import { App } from 'vue';
import { registerControlProvider } from '@ibiz-template/runtime';
import { CardSearchbar } from './card-searchbar';
import { CardSearchbarProvider } from './card-searchbar.provider';

export default {
  install(app: App): void {
    // 全局注册搜索栏插件组件
    app.component(CardSearchbar.name!, CardSearchbar);
    // 全局注册搜索栏插件适配器，SEARCHBAR_RENDER是插件类型，CARD是插件标识
    registerControlProvider(
      'SEARCHBAR_RENDER_CARD',
      () => new CardSearchbarProvider(),
    );
  },
};
